<?php

	require_once '../utils/SqlHelper.class.php';
	require_once '../utils/common.php';
	checkUserValidate();
	$userId = 0;
	if (!empty($_SESSION['userId'])) {
		$userId = $_SESSION['userId'];
	}
	$sqlHelper = new SqlHelper();
	$sql = "update j_tab_sysuser set isLogin = 0 where id = $userId";
	$sqlHelper->update($sql);
	$sqlHelper->close_connect();
	unset($_SESSION['userId']);
	header("Location: login.php?errorno=2");
	exit();
?>